<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta charset="utf-8">
	<link rel="stylesheet" href="../../static/css/bootstrap.min.css">
	<link rel="stylesheet" href="../../static/css/hm.css">
	<link rel="shortcut icon" href="../../static/img/logo.png">
	<script type="text/javascript" src="../../static/js/jquery.min.js"></script>
	<script type="text/javascript" src="../../static/js/popper.min.js"></script>
	<script type="text/javascript" src="../../static/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../../static/js/qrcode.min.js"></script>
	<script type="text/javascript" src="./shareCard.js"></script>
</head>
<body>

<div id="app">
	<!-- 左侧 -->
			<div class="left">
				<script src="../../static/fontawesomev5/js/all.min.js" data-auto-replace-svg="nest"></script>
				<style>
					* {
						margin: 0;
						padding: 0;
						list-style: none;
					}

					.logo {
						width: 170px;
						height: 55px;
						margin-top: 20px;
						margin-bottom: 20px;
						background-size: 100% 100%;
                        background-image: url('../../static/img/index_logo.png');
                    	background-position: center;
                    	background-size: 90%;
                    	background-repeat: no-repeat;
					}

					.menu-box {
						padding-left: 15px;
						padding-right: 15px;
						font-family: SourceHanSansSC-regular;
						border-top: 1px solid #fff;
						max-height: 100vh;
						background: #fff;
						width: 200px;
						/* overflow-y: auto; */
					}

					.menu {
						background-color: #fff;
						border-right: 1px solid #e6e6e6;
						list-style: none;
						position: relative;
						margin: 0;
						padding-left: 0;
						text-align: left;
						width: 170px;
						border-right: 1px solid #fff;
						height: 100%;
					}

					.sub-menu {
						background-color: #fff;
						border-right: 1px solid #e6e6e6;
						list-style: none;
						position: relative;
						margin: 0;
						padding-left: 0;
						text-align: left;
						width: 100%;
						border-right: 1px solid #fff;

					}

					.menu>ul {
						display: flex;
						flex-direction: column;
					}

					.menuitem {
						font-size: 14px;
						/*padding: 0 20px;*/
						cursor: pointer;
						position: relative;
						color: #303133;
						-webkit-transition: border-color .3s, background-color .3s, color .3s;
						transition: border-color .3s, background-color .3s, color .3s;
						-webkit-box-sizing: border-box;
						box-sizing: border-box;
						white-space: nowrap;
						margin-top: 6px;
						margin-bottom: 6px;
						border-radius: 10px;
						user-select: none;
						line-height: 40px;
						padding-left: 20px;
					}

					.menu_selected {

						color: rgb(61, 126, 255) !important;
						background-color: #e4edff !important;
					}

					.menu_hover {
						background-color: #e0e8f7 !important;
					}

					.sub-menu .menuitem a {
						/*padding-left: 20px;*/
					}


					.menu>ul>li>ul {
						display: none;
					}

					.padding {
						width: 5px;
						height: 5px;
						display: inline-block
					}

					.up {
						transform: rotateZ(180deg);
						display: inline-block;
					}

					.arrow {
						transition: all 0.5s;
						color: #999999;
					}

					.menu_selected a {
						color: rgb(61, 126, 255) !important;
					}

					.menuitem a {
						color: #303133;
						display: inline-block;
						width: 100%;

					}

					.menuitem a:hover {
						text-decoration: none;
					}
				</style>


				<div class="menu-box">
					<a href="../index/" class="index">
						<div class="logo"></div>
					</a>

					<ul class="menu">
						<!--<li class="menuitem "><a href="../userCenter/"  ><i class="fas fa-home fa-lg" ></i> <i class="padding"></i> 会员中心</a></li>-->
						<li class="menuitem "><a href="../index/"><i class="fas fa-home fa-lg"></i> <i
									class="padding"></i>统计概况</a></li>
						<li class="menuitem"><i class="fas fa-link fa-lg"> </i> <i class="padding"></i>外链管理 <span
								class="arrow"><i class="fa fa-chevron-down fa-xs"></i></span>
							<ul class="sub-menu">
								<li class="menuitem menu_selected"><a href="../jumpWeiXin/">创建链接</a></li>
								<li class="menuitem1xs"></li>
								<li class="menuitem2xs"></li>

		<!-- <li class="menuitem menu_selected"><a href="../minappLink/"  >抖音卡片管理</a></li>
            <li class="menuitem "><a href="../shareCard/"  >跳出微信</a></li>
            <li class="menuitem "><a href="../qq/"  >跳转到QQ</a></li>
            <li class="menuitem "><a href="../jinshan/"  >跳转到金山</a></li>
            <li class="menuitem "><a href="../caoliao/"  >跳转到草料</a></li>
            <li class="menuitem "><a href="../qywork/"  >跳转到企业微信</a></li> -->
							</ul>
						</li>

						<li class="menuitem"><i class="fas fa-qrcode fa-lg"> </i> <i class="padding"></i> 活码管理 <span
								class="arrow up"><i class="fa fa-chevron-down fa-xs"></i></span>
							<ul class="sub-menu">
								<li class="menuitem "><a href="../qun/">群活码</a></li>
								<li class="menuitem "><a href="../kf/">客服码</a></li>
								<li class="menuitem "><a href="../channel/">渠道码</a></li>
							</ul>
						</li>

						<li class="menuitem"><i class="fas fa-shopping-bag fa-lg"> </i> <i class="padding"></i> <a
								href="../tbk/">淘宝客管理</a></li>
						<li class="menuitem"><i class="fas fa-share-alt fa-lg"> </i> <i class="padding"></i> <a
								href="../dwz/">短网址管理</a></li>
						<li class="menuitem"><i class="fas fa-file-image fa-lg"> </i> <i class="padding"></i> <a
								href="../sucai/">素材管理</a></li>

						<li class="menuitem"><i class="fas fa-shopping-bag fa-lg"> </i> <i class="padding"></i> 系统设置
							<span class="arrow up"><i class="fa fa-chevron-down fa-xs"></i></span>
							<ul class="sub-menu">
								<li class="menuitem "><a href="../user/">会员管理</a></li>
								<li class="menuitem "><a href="../config/">域名管理</a></li>
								<!--<li class="menuitem "><a href="../config/sys_config.php"  >配置中心</a></li>-->
								<li class="menuitem "><a href="../plugin/">插件中心</a></li>
								<!--<li class="menuitem "><a href="../up/"  >在线更新</a></li>-->
							</ul>
						</li>

					</ul>

				</div>
				<div class="account" id="accountInfo"></div>

				<script>
					$(function() {
						// 为菜单添加点击事件处理程序，以展开或折叠子菜单
						$('.menu > li').click(function() {
							$(this).find('ul').slideToggle();
							$(this).find("span").toggleClass("up");
							console.log($(this).find("span"))
							event.stopPropagation();
						});

						$('.sub-menu > li').click(function() {

							event.stopPropagation();
						});

						$('.sub-menu > li').hover(function(event) {
							$(this).addClass("menu_hover")
							event.stopPropagation();
							// 当鼠标指针进入 #element 时，执行此处的代码
						}, function(event) {
							$(this).removeClass("menu_hover")
							event.stopPropagation();
							// 当鼠标指针离开 #element 时，执行此处的代码
						});

						init();
					});

					//为菜单添加默认折叠
					function init() {
						$('.menu > li:eq(2)').find("ul").hide();
						$('.menu > li:eq(6)').find("ul").hide();
					}
				</script>

			</div>

			<!-- 右侧 -->
			<div id="right">

				<h3>选择跳转智慧外链类型</h3>
				<div class="data-card">
					<div class="button-view" id="top">

						<a href="../jumpWXapp/">
							<div class="cards ">
								<img width="40" src="/static/img/xcx.png" alt="">
								<span style="padding-left: 10px;">跳转到小程序</span>
							</div>
						</a>
						<a href="../jumpWeiXin/">
							<div class="cards top_selected">
								<img width="40" src="/static/img/wx.png" alt="">
								<span style="padding-left: 10px;">跳转到微信二维码</span>
							</div>
						</a>
						<a href="../jumpJinShan/">
							<div class="cards ">
								<img width="40" src="/static/img/jinshan.png" alt="">
								<span style="padding-left: 10px;">跳转到金山文档</span>
							</div>
						</a>
						<a href="../jumpCaoLiao/">
							<div class="cards ">
								<img width="40" src="/static/img/caoliao.png" alt="">
								<span style="padding-left: 10px;">跳转到草料二维码</span>
							</div>
						</a>

						<a href="../jumpWXwork/">
							<div class="cards ">
								<img width="40" src="/static/img/qywx.png" alt="">
								<span style="padding-left: 10px;">跳转到企业微信</span>
							</div>
						</a>
						<a href="../shareCard/">
							<div class="cards ">
								<img width="40" src="/static/img/wxfx.png" alt="">
								<span style="padding-left: 10px;">微信分享卡片</span>
							</div>
						</a>
						<a href="../jumpQQ/">
							<div class="cards ">
								<img width="40" src="/static/img/qq1.png" alt="">
								<span style="padding-left: 10px;">跳转到个人QQ</span>
							</div>
						</a>
						<a href="../jumpQQqun/">
							<div class="cards ">
								<img width="40" src="/static/img/qq1.png" alt="">
								<span style="padding-left: 10px;">跳转到QQ群</span>
							</div>
						</a>


						<a href="#">
							<div class="cards ">
								<img width="40" src="/static/img/zfb.png" alt="">
								<span style="padding-left: 10px;">跳转支付宝领红包</span>
							</div>
						</a>

						<a href="../jumpLiuLanQi/">
							<div class="cards ">
								<img width="40" src="/static/img/liulanqi.png" alt="">
								<span style="padding-left: 10px;">微信跳到浏览器</span>
							</div>
						</a>

						<div style="clear: both"></div>
					</div>
				</div>
				
		<h3>分享微信卡片</h3>
		<div class="data-card">
		    
			<!-- 按钮区域 -->
			<div class="button-view" id="button-view" style="display:none;">
			    
				<button class="default-btn" 
				data-toggle="modal" 
				data-target="#createShareCardModal" 
				onclick="getDomainNameList('create');">创建卡片</button>
				
				<span class="gzhConfig">
				    <button class="tint-btn" 
				    style="margin-left:5px;" 
				    data-toggle="modal" 
				    data-target="#configshareCardModal" 
				    onclick="getshareCardConfig();">公众号配置</button>
				</span>
			</div>

			<!-- 列表区域 -->
			<div class="data-list">
				<table class="table">
				    <thead></thead>
				    <tbody></tbody>
				</table>
			</div><!-- data-list -->
			
			<p class="loading" style="display: none;"></p>
			
			<!-- 分页 -->
			<div class="fenye"></div>
			
		</div><!-- data-card -->
	</div><!-- right -->
	
	<!-- 创建卡片 -->
    <div class="modal fade" id="createShareCardModal">
        <div class="modal-dialog">
            <div class="modal-content">
                
                <!-- 头部 -->
                <div class="modal-header">
                    <h4 class="modal-title">创建卡片</h4>
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                </div><!-- modal-header -->
                
                <!-- 表单 -->
                <div class="modal-body">
                    <form id="createShareCard" enctype="multipart/form-data">

                    <span class="text">分享标题</span>
                    <input type="text" name="shareCard_title" class="form-control" placeholder="分享卡片的标题">
                    
                    <span class="text">分享摘要</span>
                    <input type="text" name="shareCard_desc" class="form-control" placeholder="分享卡片的摘要">
                    
                    <span class="text">分享缩略图</span>
                    <div class="upload-shareCard-img">
                        <div class="input-view">
                            <input type="text" name="shareCard_img" class="form-control" placeholder="分享卡片显示的图片Url">
                        </div>
                        <div class="button-view">
                            <span class="select_file button_local">
                                <span class="button_text">上传图片</span>
                                <input type="file" name="file" />
                            </span>
                            <span class="select_file button_sucaiku" onclick="getSuCai('1','createShareCardModal')">从素材库选择</span>
                        </div>
                    </div>
                    
                    <span class="text">模式</span>
                    <select name="shareCard_model" class="form-control">
                        <option value="1" title="没有认证公众号的方法">测试号</option>
                        <option value="2" title="需要认真的公众号">认证号</option>
                        <option value="3" title="无需公众号的方法">Safari分享</option>
                    </select>

                    <span class="text">落地域名</span>
                    <select name="shareCard_ldym" class="form-control" title="选择已添加到JS安全域名的域名"></select>
                
                    <span class="text">目标链接</span>
                    <input type="text" name="shareCard_url" class="form-control" placeholder="点击分享卡片后跳转的链接">
                    
                    </form>
                </div><!-- modal-body -->
                
                <!-- 底部操作 -->
                <div class="modal-footer">
                    <div class="footer-btn">
                    <div class="faqnav" title="阅读使用指南">
                        <span class="faq"><a href="../faq.php?faq=shareCard" target="_blank">?</a></span>
                    </div>
                    <div class="btnnav">
                        <button type="button" class="default-btn" onclick="createShareCard();">立即创建</button>
                    </div>
                </div>
                    
                </div><!-- modal-footer -->
                
                <!-- 操作反馈 -->
                <div class="result"></div>
                
            </div><!-- modal-content -->
        </div><!-- modal-dialog -->
    </div><!-- createShareCardModal -->
  	
  	<!-- 编辑卡片 -->
    <div class="modal fade" id="editShareCardModal">
        <div class="modal-dialog">
            <div class="modal-content">
                
                <!-- 头部 -->
                <div class="modal-header">
                    <h4 class="modal-title">编辑卡片</h4>
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                </div><!-- modal-header -->
                
                <!-- 表单 -->
                <div class="modal-body">
                    <form id="editShareCard" enctype="multipart/form-data">
                        
                    <span class="text">分享标题</span>
                    <input type="text" name="shareCard_title" class="form-control" placeholder="分享卡片的标题">
                    
                    <span class="text">分享摘要</span>
                    <input type="text" name="shareCard_desc" class="form-control" placeholder="分享卡片的摘要">
                    
                    <span class="text">分享缩略图</span>
                    <div class="upload-shareCard-img">
                        <div class="input-view">
                            <input type="text" name="shareCard_img" class="form-control" placeholder="分享卡片显示的图片Url">
                        </div>
                        <div class="button-view">
                            <span class="select_file button_local">
                                <span class="button_text">上传图片</span>
                                <input type="file" name="file" />
                            </span>
                            <span class="select_file button_sucaiku" onclick="getSuCai('1','editShareCardModal')">从素材库选择</span>
                        </div>
                    </div>
                    
                    <span class="text">模式</span>
                    <select name="shareCard_model" class="form-control"></select>
                    
                    <span class="text">落地域名</span>
                    <select name="shareCard_ldym" class="form-control" title="选择已添加到JS安全域名的域名"></select>
                
                    <span class="text">目标链接</span>
                    <input type="text" name="shareCard_url" class="form-control" placeholder="点击分享卡片后跳转的链接">
                    
                    <!--隐藏域，用于传参-->
                    <input type="hidden" name="shareCard_id" />
                    </form>
                </div><!-- modal-body -->
                
                <!-- 底部操作 -->
                <div class="modal-footer">
                    <div class="footer-btn">
                    <div class="faqnav" title="阅读使用指南">
                        <span class="faq"><a href="../faq.php?faq=shareCard" target="_blank">?</a></span>
                    </div>
                    
                    <div class="btnnav">
                        <button type="button" class="default-btn" onclick="editShareCard();">提交更新</button>
                    </div>
                </div>
                </div><!-- modal-footer -->
                
                <!-- 操作反馈 -->
                <div class="result"></div>
                
            </div><!-- modal-content -->
        </div><!-- modal-dialog -->
    </div><!-- editShareCardModal -->
  	
  	<!-- 确定删除 -->
    <div class="modal fade" id="DelshareCardModal">
        <div class="modal-dialog">
            <div class="modal-content">
                
                <!-- 头部 -->
                <div class="modal-header">
                    <h4 class="modal-title">删除分享卡片</h4>
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                </div><!-- modal-header -->
                
                <!-- 内容 -->
                <div class="modal-body">
                    将会删除该分享卡片！删除后无法恢复。
                </div><!-- modal-body -->
                
                <!-- 底部操作 -->
                <div class="modal-footer"></div><!-- modal-footer -->
                
                <!-- 操作反馈 -->
                <div class="result"></div>
                
            </div><!-- modal-content -->
        </div><!-- modal-dialog -->
    </div><!-- DelshareCardModal -->
    
    <!-- 分享卡片 -->
    <div class="modal fade" id="ShareCardModal">
        <div class="modal-dialog">
            <div class="modal-content">
                
                <!-- 头部 -->
                <div class="modal-header">
                    <h4 class="modal-title">分享卡片</h4>
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                </div><!-- modal-header -->
                
                <!-- 表单 -->
                <div class="modal-body">
                    <div class="box">
                        <div class="longUrl"><span class="text">链接：</span><span id="longUrl"></span></div>
                        <div class="Qrcode" id="shareQrcode"></div>
                        <div class="scanTips" id="scanTips">scanTips</div>
                    </div>
                </div><!-- modal-body -->
                
                <!-- 底部操作 -->
                <div class="modal-footer"></div><!-- modal-footer -->
                
                <!-- 操作反馈 -->
                <div class="result"></div>
                
            </div><!-- modal-content -->
        </div><!-- modal-dialog -->
    </div><!--  -->
    
    <!-- 公众号配置 -->
    <div class="modal fade" id="configshareCardModal">
        <div class="modal-dialog">
            <div class="modal-content">
                
                    <!-- 头部 -->
                    <div class="modal-header">
                        <h4 class="modal-title">公众号配置</h4>
                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                    </div><!-- modal-header -->
                    
                    <!-- 表单 -->
                    <div class="modal-body">
                        <form id="configshareCard">
                        <span class="text">appid</span>
                        <input type="text" name="appid" class="form-control" id="appid" autocomplete="off" placeholder="公众号appid">
                        
                        <span class="text">appsecret</span>
                        <input type="text" name="appsecret" class="form-control" id="appsecret" autocomplete="off" placeholder="公众号appsecret">
                        </form>
                        
                        <!--提醒文字-->
                        <p style="color:#999;font-size:14px;margin:15px 0;">使用测试号还需前往 <a href="https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login" target="_blank">微信公众平台测试号</a> 配置JS接口安全域名并且仅限已关注测试号的微信调用JS-SDK权限。</p>
                    </div><!-- modal-body -->
                    
                    <!-- 底部操作 -->
                    <div class="modal-footer">
                        <div class="footer-btn">
                        <div class="faqnav" title="阅读使用指南">
                            <span class="faq"><a href="../faq.php?faq=shareCard" target="_blank">?</a></span>
                        </div>
                        <div class="btnnav">
                            <button type="button" class="default-btn" onclick="configshareCard();">提交配置</button>
                        </div>
                    </div>
                    
                </div><!-- modal-footer -->
                
                <!-- 操作反馈 -->
                <div class="result"></div>
                
            </div><!-- modal-content -->
        </div><!-- modal-dialog -->
    </div><!-- configshareCardModal -->
    
    <!--素材库-->
    <div class="modal fade" id="suCaiKu">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                
                <!-- 头部 -->
                <div class="modal-header" title="点击右上角&times;可返回上一步">
                    <h4 class="modal-title">素材库</h4>
                    <span class="hideSuCaiPannel_closeIcon"></span>
                </div>
                
                <!-- 模态框主体 -->
                <div class="modal-body">
                    <div class="sucai-upload">
                        <button type="button" class="default-btn upload_sucai_button">
                            <span>上传素材</span>
                            <form id="uploadSuCaiTosuCaiKuForm" enctype="multipart/form-data">
                                <input type="file" name="file" class="upload_sucai" accept="image/*" id="uploadSuCaiTosuCaiKu" />
                                <input text="text" name="uploadSuCai_fromPannel" style="display:none;" />
                            </form>
                        </button>
                    </div>
                    
                    <!--素材容器-->
                    <div class="sucai-view"></div>
                    
                    <!--分页-->
                    <div class="fenye"></div>
                </div>
                
                <!-- 模态框底部 -->
                <div class="modal-footer">
                    <div class="footer-btn">
                    	<div class="faqnav" title="阅读使用指南">
                    	    <span class="faq"><a href="../faq.php?faq=qun" target="_blank">?</a></span>
                    	</div>
                    	<div class="btnnav">
                    	    <button type="button" class="default-btn" data-dismiss="modal" onclick="hideSuCaiPannel()">取消</button>
                    	</div>
                    </div>
                </div>
                
                <!-- 操作反馈 -->
                <div class="result"></div>
                
            </div>
        </div>
    </div><!-- suCaiKu -->

    <!-- 全局信息提示框 -->
    <div id="notification">
        <div id="notification-text"></div>
    </div>
    
</div><!-- app -->

<script>
    
    // 上传分享缩略图（创建）
    $("#selectshareCardImg").change(function(e){
        
        // 获取选择的文件
        var fileSelect = e.target.files;
        if(fileSelect.length>0){
            
            // file表单数据
            var imageData = new FormData(document.getElementById("createShareCard"));
            
            // 异步上传
            $.ajax({
                url:"../upload.php",
                type:"POST",
                data:imageData,
                cache: false,
                processData: false,
                contentType: false,
                success: function(res) {
                    
                    if(res.code == 200){
                        
                        // 上传成功
                        $('#shareCard_img').val(res.url);
                        
                        // 清空file选择的文件以重试
                        $("#selectshareCardImg").val('');
                        $("#createShareCardModal .select_text").text('重新上传');
                        
                    }else{
                        
                        // 上传失败
                        showErrorResult(res.msg)
                        
                        // 清空file选择的文件以重试
                        $("#selectshareCardImg").val('');
                    }
                    
                    $('#app .result').html('<div class="success">'+res.msg+'</div>');
                    $('#app .result .success').css('display','block');
                    setTimeout('hideResult()', 1300); // 1.3秒后自动关闭
                    
                },
                error: function() {
                    
                    // 上传失败
                    showErrorResult('服务器发生错误！可按F12打开开发者工具点击Network或网络查看返回信息进行排查！')
                    
                    // 清空file选择的文件以重试
                    $("#selectshareCardImg").val('');
                },
                beforeSend: function(res){
                
                    // 上传中
                    $('#app .result').html('<div class="success">上传中...</div>');
                    $('#app .result .success').css('display','block');
                }
            })
        }
    })
    
    // 上传分享缩略图（编辑）
    $("#selectshareCardImg_edit").change(function(e){
        
        // 获取选择的文件
        var fileSelect = e.target.files;
        if(fileSelect.length>0){
            
            // file表单数据
            var imageData = new FormData(document.getElementById("editShareCard"));
            
            // 异步上传
            $.ajax({
                url:"../upload.php",
                type:"POST",
                data:imageData,
                cache: false,
                processData: false,
                contentType: false,
                success: function(res) {
                    
                    if(res.code == 200){
                        
                        // 上传成功
                        $('#shareCard_img_edit').val(res.url);
                        
                        // 清空file选择的文件以重试
                        $("#selectshareCardImg_edit").val('');
                        $("#editShareCardModal .select_text").text('重新上传');
                        
                    }else{
                        
                        // 上传失败
                        showErrorResult(res.msg)
                        
                        // 清空file选择的文件以重试
                        $("#selectshareCardImg_edit").val('');
                    }
                    
                    $('#app .result').html('<div class="success">'+res.msg+'</div>');
                    $('#app .result .success').css('display','block');
                    setTimeout('hideResult()', 1300); // 1.3秒后自动关闭
                    
                },
                error: function() {
                    
                    // 上传失败
                    showErrorResult('服务器发生错误！可按F12打开开发者工具点击Network或网络查看返回信息进行排查！')
                    
                    // 清空file选择的文件以重试
                    $("#selectshareCardImg_edit").val('');
                },
                beforeSend: function(res){
                
                    // 上传中
                    $('#app .result').html('<div class="success">上传中...</div>');
                    $('#app .result .success').css('display','block');
                }
            })
        }
    })

</script>
</body>
</html>